﻿
using System;

namespace GECS.Core {

	/// <summary>
	/// This class contains static fields which can be called by any sprite, or the game class itself.
	/// </summary>
    public class Global {

        /// <summary>
        /// The window title.
        /// </summary>
        public static String TITLE = "GECS - The simplest GameEngine for C#";
        
        /// <summary>
        /// The window width.
        /// </summary>
        public static int WIDTH = 640;
        
        /// <summary>
        /// The window height.
        /// </summary>
        public static int HEIGHT = 480;
        
        /// <summary>
        /// The switch for pixel perfect collision detection.
        /// </summary>
        public static bool USE_PIXELPERFECT_COLLISION = false;
        
        /// <summary>
        /// The property to show or hide cursor.
        /// </summary>
        public static bool HIDE_CURSOR = false;
        
        /// <summary>
        /// The switch for full screen mode.
        /// </summary>
        public static bool FULLSCREEN = false;
        
        /// <summary>
        /// The speed of the game in steps for second. This is the speed with which
        /// the game will be updated. You can experiment with change in this value to
        /// see which speed aptly suites your game.
        /// </summary>
        public static int STEPS_FOR_SECOND = 33;
        
        /// <summary>
        /// The FPS of the game.
        /// </summary>
        public static int FRAMES_PER_SECOND = 60;
        
        /// <summary>
        /// The actual speed of the game in steps per second.
        /// </summary>
        public static int ACTUAL_STEPS_FOR_SECOND = 33;
        
        /// <summary>
        /// The percentage of the updates done by the engine. Best if the percentage is greater than 70.
        /// </summary>
        public static int UPDATE_RATE = 0;
        
        /// <summary>
        /// Constant containing the current GECS version.
        /// </summary>
        public const String GECS_VERSION = "GECS V0.1";

        /// <summary>
        /// Sets the time for each step to take place. Any negative time will be made equal to one second.
        /// </summary>
        /// <param name="time">The time for each step (in ms)</param>
        public static void SET_TIME_FOR_EACH_STEP(int time) {
            if (time <= 0) {
                time = 1;
            }
            STEPS_FOR_SECOND = 1000/time;
        }

    }

}
